 	<?php get_header(); ?>

 	<link media="screen" href="<?php bloginfo('template_directory'); ?>/richfiles1.css" type="text/css" rel="stylesheet" />
	<link media="screen" href="<?php bloginfo('template_directory'); ?>/isotopes1.css" type="text/css" rel="stylesheet" />

	<script src="<?php bloginfo('template_directory'); ?>/js/jquery.isotope.min.js"></script>
	<script src="<?php bloginfo('template_directory'); ?>/js/mousewheel.js"></script>
	<script src="<?php bloginfo('template_directory'); ?>/js/richfiles.js"></script>
	

			<div class="container-inner">
				<div class="gallery relative shadow">
					<div class="inner-images clearfix">
						<div class="galleryImages">
							<a class="fleft relative imageHover" href="/">
								<img src="<?php bloginfo('template_directory'); ?>/images/gallery.jpg">
								<div class="hide hoverTxt absolute">
									<div class="row">
										<div class="column align-middle innerTxt">
										    <span class="topDesc">Veteran Iron man fame Robert Downey Jr is famous American actor and style icon. Robert got acting in his genes.</span><br />
											<span class="hoverTitle">Paris hilton</span>
										</div>
									</div>
								</div>
							</a>

							<?php query_posts(array('post_type' => 'richfiles', 'posts_per_page' => 10 ));
							if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

								<a class="fleft relative imageHover" href="<?php the_permalink() ?>" >
									<?php 
									if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
									  echo get_the_post_thumbnail( get_the_ID(), array(200,225) );
									} 
									?>
									<div class="hide hoverTxt absolute">
										<div class="row">
											<div class="column align-middle innerTxt">
											    <span class="topDesc"><?php the_excerpt() ?></span><br />
												<span class="hoverTitle"><?php the_title() ?></span>
											</div>
										</div>
									</div>
								</a>

							<?php endwhile;// end of the loop. ?>	

						</div>			
					</div>
				</div>
				
				<section id="content" class="">
					<div id="container" class="super-list variable-sizes clearfix">	

						<?php

							$key = 'Estates and Homes';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_primary_data);
							  
								?>
									<div class="element width650 height500">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#estates"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
															<a href="javascript:;"><i class="icon-pin"></i></a>
															<a href="javascript:;"><i class="icon-facebook"></i></a>
															<a href="javascript:;"><i class="icon-twitter"></i></a>
															<a href="javascript:;"><i class="icon-linkedin"></i></a>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
									      			<div class="clear"></div>
													<div class="desc">
														<div class="descHeading clearfix">
															<span class="fleft"><?php echo $post_groups[$key][0]['Gallery']['title'] ?></span>
															<a href="" class="fright button button-plus"><i class="icon-edit"></i></a>
														</div>
														<div class="descDetail"><?php echo $post_groups[$key][0]['Gallery']['desc'] ?></div>
													</div>
												</div>
											</div>
								      	</div>
								    </div>
						   		 <?php

								}

							}
								
						


						//

							$key = 'Autos and Cars';

							$my_var = get_meta_values( $key, 4);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $i=>$post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>
									<div class="element <?php  echo ($i%2) ? 'width350' : 'width300' ?> height250">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#autos"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>
								     <?php

								}

							}
							?>	
						
						<!--div class="element width300 height250">
							<div class="content">
								<img src="<?php bloginfo('template_directory'); ?>/images/ad3x2.jpg"></img>
					      	</div>
					    </div-->
						
					    <?php
						//

							$key = 'Hobbies';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>
									<div class="element <?php  echo ($i%2) ? 'width350' : 'width300' ?>  height250">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#hobbies"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>
								     <?php

								}

							}
							
							$key = 'Islands';

								$my_var = get_meta_values( $key, 3);

								if( !empty( $my_var ) )
								{
								    foreach( $my_var as $post_id )
								    {
								   		$post_groups = get_post_groups($post_id, $key );
								   		$post_primary_data = get_post_group_primary( $post_id );

								   		//print_r($post_groups[$key][0]);
								   		//print_r($post_primary_data);
								  
									?>
						    
									    <div class="element width500 height400">
											<div class="content">
												<a href="<?php echo get_permalink( $post_id ) ?>#island"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
									      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
									      		<div class="absolute details row">
									      			<div class="column">
										      			<div class="upperDetails relative clearfix">
										      				<div class="fleft social absolute">
										      					<i class="icon-share"></i>
															</div>
										      				<div class="fright ownerDetails relative">
										      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
																<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
															</div>
										      			</div>
													</div>
												</div>
									      	</div>
									    </div>

								     <?php

									}
								}

						//

							$key = 'Yachts';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>

									<div class="element <?php  echo ($i%2) ? 'width350' : 'width300' ?>  height250">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#yatch"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>
					   		  <?php

								}

							}
							
							//

							$key = 'Wedding';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>

								    <div class="element <?php  echo ($i%2) ? 'width350' : 'width300' ?>  height250">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#wedding"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>
						   		 <?php

								}

							}
							

							$key = 'Friends';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>
								   <div class="element width150 height150" >
								    	<div class="content family">
											<a class="hoverSmallImg" href="<?php echo get_permalink( $post_id ) ?>#friends">
										      <span class="hide absolute middleTxt"><?php echo $post_groups[$key][0]['Name'] ?></span> 
										      <img src="<?php echo $post_groups[$key][0]['Image']['view'] ?>"></img>
										      <span class="hide hoverCard"></span>
										   	</a>
										</div>
									</div>
								      <?php

								}

							}
							
					    
					    //

							$key = 'Private jets';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>
					    
								    <div class="element width650 height400">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#jets"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>

								     <?php

									}
								}
								
								//

								
								?>
					    
					    <div class="element width150 height550">
							<div class="content">
								<img src="<?php bloginfo('template_directory'); ?>/images/longad.jpg"></img>
					      	</div>
					    </div>

					    <?php
					    //

								$key = 'Holiday Destinations(Getaways)';

								$my_var = get_meta_values( $key, 3);

								if( !empty( $my_var ) )
								{
								    foreach( $my_var as $post_id )
								    {
								   		$post_groups = get_post_groups($post_id, $key );
								   		$post_primary_data = get_post_group_primary( $post_id );

								   		//print_r($post_groups[$key][0]);
								   		//print_r($post_primary_data);
								  
									?>

								    <div class="element width500 height400">
										<div class="content">
											<a href="<?php echo get_permalink( $post_id ) ?>#holidays"><img src="<?php echo $post_groups[$key][0]['Gallery']['elements'][0]['view'] ?>"></img></a>
								      		<div class="absolute cornerTxt"><?php echo strtoupper($key) ?></div>
								      		<div class="absolute details row">
								      			<div class="column">
									      			<div class="upperDetails relative clearfix">
									      				<div class="fleft social absolute">
									      					<i class="icon-share"></i>
														</div>
									      				<div class="fright ownerDetails relative">
									      					<div class="absolute txt">OWNED BY <br/><?php echo get_the_title( $post_id ) ?></div>
															<div class="image width100"><img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></div>
														</div>
									      			</div>
												</div>
											</div>
								      	</div>
								    </div>
								    <?php

									}
								}
								

						//

					    $key = 'Family';

							$my_var = get_meta_values( $key, 3);

							if( !empty( $my_var ) )
							{
							    foreach( $my_var as $post_id )
							    {
							   		$post_groups = get_post_groups($post_id, $key );
							   		$post_primary_data = get_post_group_primary( $post_id );

							   		//print_r($post_groups[$key][0]);
							   		//print_r($post_primary_data);
							  
								?>
								      <div class="element width150 height150" >
								    	<div class="content family">
											<a class="hoverSmallImg" href="<?php echo get_permalink( $post_id ) ?>#family">
										      <span class="hide absolute middleTxt"><?php echo $post_groups[$key][0]['Name'] ?>, <?php echo $post_groups[$key][0]['Relationship'] ?></span> 
										      <img src="<?php echo $post_groups[$key][0]['Image']['view'] ?>"></img>
										      <span class="hide hoverCard"></span>
										   	</a>
										</div>
									</div>
								      <?php

								}

							}
							?>
					   
						
						<!--div class="element width350 height350">
							<div class="content">
								<img src="<?php bloginfo('template_directory'); ?>/images/jet.jpg"></img>
					      		<div class="absolute cornerTxt">AUTO</div>
					      		<div class="absolute details row">
					      			<div class="column">
						      			<div class="upperDetails relative clearfix">
						      				<div class="fleft social absolute">
						      					<i class="icon-share"></i>
											</div>
						      				<div class="fright ownerDetails relative">
						      					<div class="absolute txt">OWNED BY <br/>JUSTIN BIEBER</div>
												<div class="image"><img src="<?php bloginfo('template_directory'); ?>/images/ownerimage.jpg"></img></div>
											</div>
						      			</div>
									</div>
								</div>
					      	</div>
					    </div>
					    
					   
					    <div class="element width500 height350">
							<div class="content">
								<img src="<?php bloginfo('template_directory'); ?>/images/collection1.jpg"></img>
					      		<div class="absolute cornerTxt">COLLECTIONS</div>
					      		<div class="absolute details row">
					      			<div class="column">
						      			<div class="upperDetails relative clearfix">
						      				<div class="fleft social absolute">
						      					<i class="icon-share"></i>
											</div>
						      				<div class="fright ownerDetails relative">
						      					<div class="absolute txt">OWNED BY <br/>SULTAN OF BRUNI</div>
												<div class="image"><img src="<?php bloginfo('template_directory'); ?>/images/ownerimage.jpg"></img></div>
											</div>
						      			</div>
									</div>
								</div>
					      	</div>
					    </div-->
					   
						
					    
					    <div class="element width150 height550">
							<div class="content">
								<img src="<?php bloginfo('template_directory'); ?>/images/longad.jpg"></img>
					      	</div>
					    </div>
					   
						
					</div>
				</section>
			</div><!-- /.container-inner -->
	<?php get_footer(); ?>